
// import { createStore, applyMiddleware, combineReducers } from 'redux'
// // 引入home模块
// import { homeReducer } from './modules/home'
// // 引入打印的中间件
// import logger from 'redux-logger'
// // 引入异步thunk
// import thunk from 'redux-thunk'
// // 使用redux-devtools工具---控制台显示数据
// import { composeWithDevTools } from 'redux-devtools-extension'

import {
    createStore,
    applyMiddleware,
    combineReducers
} from "redux"

//引入home模块
import {
    homeReducer
} from "./modules/home"

import { cateReducer } from "./modules/cate"
import { detailReducer } from "./modules/detail"
import { loginReducer } from "./modules/login"
import { registerReducer } from "./modules/register"
import { shopReducer } from "./modules/shop"
import { mineReducer } from "./modules/Mine"
import { couponReducer } from "./modules/coupon"
//引入打印的中间件
import logger from "redux-logger"
//做异步
import thunk from "redux-thunk"
//使用redux-devtools ，控制台显示数据
import {
    composeWithDevTools
} from "redux-devtools-extension"

//整合单个组件的仓库

let reducer = combineReducers({
    home: homeReducer,
    cate: cateReducer,
    detail: detailReducer,
    login:loginReducer,
    register:registerReducer,
    shop:shopReducer,
    mine:mineReducer,
    coupon:couponReducer
})

// 1.创建仓库
let store = createStore(reducer, composeWithDevTools(applyMiddleware(thunk, logger)))
// 2.导出仓库
export default store;
